# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerability do
  @moduledoc """
  A vulnerability affecting the VM instance.

  ## Attributes

  *   `availableInventoryItemIds` (*type:* `list(String.t)`, *default:* `nil`) - Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. If the vulnerability report was not updated after the VM inventory update, these values might not display in VM inventory. If there is no available fix, the field is empty. The `inventory_item` value specifies the latest `SoftwarePackage` available to the VM that fixes the vulnerability.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp for when the vulnerability was first detected.
  *   `details` (*type:* `GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails.t`, *default:* `nil`) - Contains metadata as per the upstream feed of the operating system and NVD.
  *   `installedInventoryItemIds` (*type:* `list(String.t)`, *default:* `nil`) - Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. This field displays the inventory items affected by this vulnerability. If the vulnerability report was not updated after the VM inventory update, these values might not display in VM inventory. For some distros, this field may be empty.
  *   `items` (*type:* `list(GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityItem.t)`, *default:* `nil`) - List of items affected by the vulnerability.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp for when the vulnerability was last modified.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :availableInventoryItemIds => list(String.t()) | nil,
          :createTime => DateTime.t() | nil,
          :details =>
            GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails.t() | nil,
          :installedInventoryItemIds => list(String.t()) | nil,
          :items =>
            list(GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityItem.t()) | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:availableInventoryItemIds, type: :list)
  field(:createTime, as: DateTime)
  field(:details, as: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails)
  field(:installedInventoryItemIds, type: :list)
  field(:items, as: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityItem, type: :list)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerability do
  def decode(value, options) do
    GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerability.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerability do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
